<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>块级作用域</title>
</head>
<body>
    <script>
        {
            var num = 10;
        }
        console.log(num);//可以访问
    </script>
</body>
</html>